<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>物流数据</title>
  <script type="text/javascript" src="../wuliu/jquery-1.10.2/jquery.min.js"></script>
  <script src="../wuliu/js/tableXR.js"></script>
  <link rel="stylesheet" type="text/css" href="../wuliu/font-awesome-4.7.0/css/font-awesome.min.css">
</head>
<body>
<div id="root" style="width: 100%"></div>
<div  style="font-family: serif;position: fixed;left: 15px;top: 1px;z-index: 999999;">
  <ul>
    <li>
      <i class="fa fa-home" aria-hidden="true" onclick="wuliuhaome()"></i>
      <!--<a href="/wuliutable" class="rota">首页</a>-->
    </li>
  </ul>
</div>
<script type="text/javascript">
  function wuliuhaome(){
    window.location.href="/wuliu"
  }
  var result;
  $.ajax({
    //几个参数需要注意一下
    type: "POST",//方法类型
    dataType: "json",//预期服务器返回的数据类型
    url: "/gettable" ,//url
    success: function (data) {
      if (data.msg === '0'){
        console.log("失败");
        alert("失败："+JSON.stringify(data))
      }else {
        console.log(data)
        result = data.result;

        $('#root').tableXR({
          //表格标题
          title:'物流数据列表',
          //表格头部设置
          columns:[
            {data:'id',title:'序号'},
            {data:'code',title:'编号'},
            {data:'deliveryname',title:'名称'},
            {data:'sendcity',title:'原寄地'},
            {data:'receiveprovince',title:'目的省'},
            {data:'receivecity',title:'目的城市'},
            {data:'fww',title:'首重重量'},
            {data:'fwp',title:'首重价格'},
            {data:'wu',title:'价段上限'},
            {data:'wd',title:'价段下限'},
            {data:'wp',title:'价段单价'},
            {data:'fw',title:'价格层次'},
            {data:'discount',title:'折扣'},
            {data:'discounttype',title:'折扣类型'},
          ],
          //表格数据：
          data: result
        })

      }


    }

  });



</script>
</body>
</html>